<?php
$db=new PDO('mysql:host=localhost;dbname=db', 'root', '12qwas');
$result=$db->query("select cy as 成语, first 首字 from chengyu limit 2");
    foreach($result as $row){
        //print-r($row);
        echo "{$row[0]}--------{$row['首字']}\n";
    }